Details about prototype and prototype chain in JavaScript -- Item15
Those who have used JavaScript must be familiar with prototype. However, this makes it difficult for beginners to understand that a function has a prototype attribute, you can add
Prototype originated from French. The software standards are translated as "prototype", which represents the initial form of things and also contains the meaning of models and templates. The prototype concept in JavaScript exactly reflects the
Used JavaScript students are sure to prototype thunderclap piercing, but this is what it is a beginner mixed, only know that the function will have a prototype attribute, you can add a function for instance access, the other is not clear, recently
The prototype concept in JavaScript exactly reflects the content of the word. We cannot understand it as a pre-declared concept of prototype in C ++.All function objects in JavaScript have a prototype attribute. This prototype attribute is an object
The concept of prototype in JavaScript aptly reflects the meaning of the word, and we cannot interpret it as a prototype concept of C + +.
All of the function-type objects of JavaScript have a prototype attribute. The prototype property itself is an
The prototype of Javascript is always confusing. No matter how experienced experts or the author himself, he often shows limited understanding of this concept, I think this confusion has emerged when we first came into contact with prototypes. They
Prototype and prototype in JavaScript
What is the prototype?
The Function type has a prototype attribute, which is translated as a prototype. This attribute is a pointer pointing to an object that contains some attributes and methods that are shared
I. Function creation process
Before learning about the prototype chain, let's take a look at what a function does during creation. Let's take an example of an empty function:
1 function (){};
When we declare such an empty function in the Code, the
I read "talking about JS object-oriented programming" a few days ago. At that time, I asked haoshen to findArticleIn some cases, it may be misleading (or different from ECMA). Later I flipped through ECMA and finally found the "standard ......This
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.